package day_2022_4_to_7.day48;

/**
 * 收件人列表
 * @author haomin
 * @date 2022/06/02 17:03
 **/

import java.util.Scanner;

public class Day34_1_NameList {
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextLine()) {
            int n = Integer.parseInt(in.nextLine());
            String[] arr = new String[n];
            for (int i = 0; i < n; i++) {
                String cur = in.nextLine();
                if (cur.contains(",") || cur.contains(" ")) cur = "\"" + cur + "\"";
                arr[i] = cur;
            }
            for (int i = 0; i < n; i++) {
                if(i == n-1) System.out.println(arr[i]);
                else System.out.print(arr[i] + ", ");
            }
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextLine()) {
            int n = Integer.parseInt(sc.nextLine());
            String result = "";
            for (int i = 0; i < n; i++) {
                String cur = sc.nextLine();
                if (cur.contains(",") || cur.contains(" ")) cur = "\"" + cur + "\"";
                if(i != n-1) {
                    result += cur;
                    result += ", ";
                }else result += cur;
            }
            System.out.println(result);
        }
    }
}